{% extends 'base_foot.html' %}
{% load static %}

{% block header %}
    <div class="header_con">
        <div class="header">
            <div class="welcome fl">欢迎来到天天生鲜!</div>
            <div class="fr">
                {% if request.session.user_name %}
                <div class="user_link fl">
                    欢迎您：<em >{{request.session.user_name}} </em>！
                    <span>|</span>
                    <a href="/goods">首页</a>
                    <span>|</span>
                    <a href="/user/info">用户中心</a>
                    <span>|</span>
                    <a href="/cart">我的购物车</a>
                    <span>|</span>
                    <a href="/user/order1">我的订单</a>
                    <span>|</span>
                    <a href="/user/logout">退出</a>
                </div>
                {% else %}
                <div class="login_btn fl">
                    <a href="/user/login">登录</a>
                    <span>|</span>
                    <a href="/user/register">注册</a>
                </div>
                {% endif %}
<!--                <div class="login_info fl">-->

<!--                    欢迎您：<em>{{user_name}} </em>！-->
<!--                </div>-->

<!--                <div class="login_btn fl">-->
<!--                    <span>|</span>-->
<!--                    <a href="/user/login">登录</a>-->
<!--                    <span>|</span>-->
<!--                    <a href="/user/register">注册</a>-->
<!--                </div>-->

            </div>
        </div>
    </div>

    <div class="search_bar clearfix">
        <a href="index.html" class="logo fl"><img src="{% static 'images/logo.png' %}"></a>
       {% if user_center %}
        <!-- 用户中心的场景 -->
        <div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;用户中心</div>
        <div class="search_con fr">
            <form method="get" action="/search">
            <input type="text" class="input_text fl" name="q" placeholder="搜索商品">
            <input type="submit" class="input_btn fr" name="" value="搜索" >
            </form>
        </div>
        {% endif %}

        {% if guest_cart %}
        <!-- 商品界面的场景 -->
        <div class="search_con fl">
            <form method="get" action="/search">
            <input type="text" class="input_text fl" name="q" placeholder="搜索商品">
            <input type="submit" class="input_btn fr" name="" value="搜索">
                </form>
        </div>
        <div class="guest_cart fr">
            <a href="/cart" class="cart_name fl">我的购物车</a>
            <div class="goods_count fl" id="show_count">{{result}}</div>
        </div>
        {% endif %}
        {% if cart %}

        <div class="search_bar clearfix">

		<div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;购物车</div>
		<div class="search_con fr">
            <form method="get" action="/search">
			<input type="text" class="input_text fl" name="q" placeholder="搜索商品">
			<input type="submit" class="input_btn fr" name="" value="搜索">
                </form>
		</div>
	</div>
        {% endif %}
        {% if orders %}
        <div class="search_bar clearfix">

		<div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;提交订单</div>
		<div class="search_con fr">
            <form method="get" action="/search">
			<input type="text" class="input_text fl" name="q" placeholder="搜索商品">
			<input type="submit" class="input_btn fr" name="" value="搜索">
                </form>
		</div>
	</div>
        {% endif %}
        {% block detail3 %}

        {% endblock detail3 %}
    </div>
{% endblock header %}